<?php

namespace app\admin\traits;

use app\common\model\Consulting;

/**
 * 统计
 * Trait StatisticsTrait
 * @package app\admin\traits
 */
trait StatisticsTrait
{

    /**
     * 提问人数
     * @param $startTime
     * @param $endTime
     * @return int
     */
    private function questionMemberNum($startTime, $endTime): int
    {
        return Consulting::timeRange($startTime, $endTime, 'created', 'created')
            ->where('status', '>=', 1)
            ->group('memberId')
            ->count();
    }
}
